#ifndef ACCOUNT_HH
#define ACCOUNT_HH
#include "IAccount.hh"
#include "Transaction.hh"
#include <vector>

class Account : public IAccount {
protected:
    std::string accountId;
    std::string ownerName;
    double balance;
    std::vector<Transaction> transactions;

public:
    Account(const std::string& owner, const std::string& id);
    
    std::string getAccountId() const override { return accountId; }
    double getBalance() const override { return balance; }
    void addTransaction(const Transaction& transaction) override;
    const std::vector<Transaction>& getTransactions() const override { return transactions; }
    std::string getOwnerName() const override { return ownerName; }
    
    virtual bool transfer(IAccount& destination, double amount, const std::string& note) override;
    
protected:
    void updateBalance(double amount);
};



#endif // ACCOUNT_H